package comparator;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

public class Test {
    public static void main(String args[]){
        List<Employee_2> list = new ArrayList();

        list.add(new Employee_2(18, 2000, "男"));
        list.add(new Employee_2(19, 2000, "女"));
        list.add(new Employee_2(15, 2000, "男"));
        list.add(new Employee_2(18, 2000, "女"));
        list.add(new Employee_2(17, 2000, "男"));
        Collections.sort(list, new EmpCom());

        for (Employee_2 employees : list) {
            System.out.print(employees.sarly + " ");
            System.out.print(employees.age + " ");
            System.out.print(employees.name + " ");
            System.out.println();
        }
    }
}
